export const createSteps = function (order) {
    let steps = [];
    // 当前步骤
    let curStep = 0;
    // 组件名称
    let componentName = '';
    let checkop = params ? (type == 3 ? (params.auditOptions ? params.auditOptions[0] : '') : (params.checkOptions ? params.checkOptions[0] : '')) : '';
    const yunshutingche = [{
        label: '提交申请'
    }, {
        label: '部门审核'
    }];
    const { params, type, orderType } = order
    switch (order.itemName) {
        case "出土项目申报":
            componentName = 'chutuShenbao'
            steps = [{
                label: '提交申请'
            }, {
                label: '现场踏勘'
            }, {
                label: '部门审核'
            }, {
                label: '渣土办审核'
            }];
            if (params) {
                if (type == 1) {
                    curStep = checkop == 2 ? 3 : checkop == 1 ? 1 : curStep
                }
                if (type == 1 && orderType == 0 && checkop == 1) {
                    curStep = 0
                }
                if (type == 10 || type == 11) {
                    curStep = orderType == 0 ? 1 : orderType == 1 ? (type == 10 ? 1 : type == 1 ? 2 : curStep) : curStep
                }
            }
            break;
        case "停车场申请":
            componentName = 'xiaonaKuangkeng'
            steps = yunshutingche;
            curStep = 1;
            break;
        case "运输企业申请":
            componentName = 'yunnshuQiye'
            steps = yunshutingche;
            curStep = 1;
            break;
        case "消纳审核（矿坑）":
            componentName = 'xiaonaKuangkeng'
            steps = [{
                label: '提交申请'
            }, {
                label: '初步审核'
            }, {
                label: '联合踏勘'
            }, {
                label: '初步方案'
            }, {
                label: '联合会审'
            }, {
                label: '渣土办审核'
            }];
            if (params) {
                if (type == 1) {
                    curStep = checkop == 1 ? 1 : curStep
                } else if (type == 3) {
                    curStep = checkop == 3 ? 3 : checkop == 5 ? 5 : curStep
                } else if (type == 10 || type == 11) {
                    if (nodeName == '联合会审') {
                        curStep = 4
                    } else {
                        curStep = orderType == 0 ? 1 : orderType == 1 ? (type == 10 ? 1 : type == 11 ? 2 : curStep) : curStep
                    }
                }
            }
            break;
        case '消纳审核（工程类）':
            componentName = 'xiaonaGongcheng'
            steps = [{
                label: '提交申请'
            }, {
                label: '国有初核'
            }, {
                label: '部门审核'
            }, {
                label: '自规局审'
            }, {
                label: '渣土办审核'
            }]
            if (params) {
                if (type == 1) {
                    curStep = (checkop != 2 && checkop != 1) ? 1 : curStep
                } else if (type == 3) {
                    curStep = checkop == 1 ? 3 : checkop == 2 ? 4 : curStep
                } else if (type == 10 || type == 11) {
                    curStep = orderType == 0 ? 1 : orderType == 1 ? (type == 10 ? 1 : type == 11 ? 2 : curStep) : curStep
                }
            }
            break;
        default:
            componentName = 'changdiChutu'
            steps = [{
                label: '提交申请'
            }, {
                label: '交水审核'
            }, {
                label: '运输企业'
            }, {
                label: '渣土办'
            }, {
                label: '交警审核'
            }];
            if (params) {
                curStep = 1
                if (type == 1) {
                    curStep = checkop == 2 ? 3 : checkop == 1 ? 1 : curStep
                }
                if (type == 1 && orderType == 0 && checkop == 1) {
                    curStep = 0
                }
                if (type == 10 || type == 11) {
                    curStep = orderType == 0 ? 1 : orderType == 1 ? (type == 10 ? 1 : type == 11 ? 2 : curStep) : curStep
                }
            }
    }
    order.currentStep = curStep
    order.steps = steps
    order.componentName = componentName
    order.checkop = checkop
}